package eval

import (
	"showen/obj"
	"testing"
)

func TestInputPortP(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := InputPortP([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("InputPortP with no arguments should return an error")
	}

	// Test with input port
	inputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = InputPortP([]obj.Object{inputPort}, env)
	if result.Type() != obj.BOOLEAN_OBJ || !result.(*obj.BooleanObject).Value {
		t.Errorf("InputPortP with input port should return #t")
	}

	// Test with output port
	outputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = InputPortP([]obj.Object{outputPort}, env)
	if result.Type() != obj.BOOLEAN_OBJ || result.(*obj.BooleanObject).Value {
		t.Errorf("InputPortP with output port should return #f")
	}

	// Test with non-port object
	result = InputPortP([]obj.Object{obj.NULL_OBJECT}, env)
	if result.Type() != obj.BOOLEAN_OBJ || result.(*obj.BooleanObject).Value {
		t.Errorf("InputPortP with non-port should return #f")
	}
}

func TestOutputPortP(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := OutputPortP([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("OutputPortP with no arguments should return an error")
	}

	// Test with output port
	outputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = OutputPortP([]obj.Object{outputPort}, env)
	if result.Type() != obj.BOOLEAN_OBJ || !result.(*obj.BooleanObject).Value {
		t.Errorf("OutputPortP with output port should return #t")
	}

	// Test with input port
	inputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = OutputPortP([]obj.Object{inputPort}, env)
	if result.Type() != obj.BOOLEAN_OBJ || result.(*obj.BooleanObject).Value {
		t.Errorf("OutputPortP with input port should return #f")
	}

	// Test with non-port object
	result = OutputPortP([]obj.Object{obj.NULL_OBJECT}, env)
	if result.Type() != obj.BOOLEAN_OBJ || result.(*obj.BooleanObject).Value {
		t.Errorf("OutputPortP with non-port should return #f")
	}
}

func TestCurrentInputPort(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with arguments
	result := CurrentInputPort([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CurrentInputPort with arguments should return an error")
	}

	// Test with no arguments
	result = CurrentInputPort([]obj.Object{}, env)
	if result.Type() != obj.PORT_OBJ {
		t.Errorf("CurrentInputPort with no arguments should return a port")
	}

	port := result.(*obj.PortObject)
	if !port.IsInput {
		t.Errorf("CurrentInputPort should return an input port")
	}
}

func TestCurrentOutputPort(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with arguments
	result := CurrentOutputPort([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CurrentOutputPort with arguments should return an error")
	}

	// Test with no arguments
	result = CurrentOutputPort([]obj.Object{}, env)
	if result.Type() != obj.PORT_OBJ {
		t.Errorf("CurrentOutputPort with no arguments should return a port")
	}

	port := result.(*obj.PortObject)
	if port.IsInput {
		t.Errorf("CurrentOutputPort should return an output port")
	}
}

func TestCharReadyP(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with too many arguments
	result := CharReadyP([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CharReadyP with too many arguments should return an error")
	}

	// Test with non-port argument
	result = CharReadyP([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CharReadyP with non-port argument should return an error")
	}

	// Test with closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: true,
	}
	result = CharReadyP([]obj.Object{closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CharReadyP with closed port should return an error")
	}

	// Test with output port
	outputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = CharReadyP([]obj.Object{outputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CharReadyP with output port should return an error")
	}

	// Test with valid input port
	inputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = CharReadyP([]obj.Object{inputPort}, env)
	if result.Type() != obj.BOOLEAN_OBJ {
		t.Errorf("CharReadyP with valid port should return a boolean")
	}

	// Test with no arguments
	result = CharReadyP([]obj.Object{}, env)
	if result.Type() != obj.BOOLEAN_OBJ {
		t.Errorf("CharReadyP with no arguments should return a boolean")
	}
}

func TestCallWithInputFile(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with wrong number of arguments
	result := CallWithInputFile([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CallWithInputFile with wrong number of arguments should return an error")
	}

	// Test with non-string first argument
	result = CallWithInputFile([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CallWithInputFile with non-string first argument should return an error")
	}

	// Test with non-procedure second argument
	result = CallWithInputFile([]obj.Object{&obj.StringObject{Value: "test.txt"}, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CallWithInputFile with non-procedure second argument should return an error")
	}
}

func TestCallWithOutputFile(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with wrong number of arguments
	result := CallWithOutputFile([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CallWithOutputFile with wrong number of arguments should return an error")
	}

	// Test with non-string first argument
	result = CallWithOutputFile([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CallWithOutputFile with non-string first argument should return an error")
	}

	// Test with non-procedure second argument
	result = CallWithOutputFile([]obj.Object{&obj.StringObject{Value: "test.txt"}, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("CallWithOutputFile with non-procedure second argument should return an error")
	}
}

func TestWithInputFromFile(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with wrong number of arguments
	result := WithInputFromFile([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WithInputFromFile with wrong number of arguments should return an error")
	}

	// Test with non-string first argument
	result = WithInputFromFile([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WithInputFromFile with non-string first argument should return an error")
	}

	// Test with non-procedure second argument
	result = WithInputFromFile([]obj.Object{&obj.StringObject{Value: "test.txt"}, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WithInputFromFile with non-procedure second argument should return an error")
	}
}

func TestWithOutputToFile(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with wrong number of arguments
	result := WithOutputToFile([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WithOutputToFile with wrong number of arguments should return an error")
	}

	// Test with non-string first argument
	result = WithOutputToFile([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WithOutputToFile with non-string first argument should return an error")
	}

	// Test with non-procedure second argument
	result = WithOutputToFile([]obj.Object{&obj.StringObject{Value: "test.txt"}, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WithOutputToFile with non-procedure second argument should return an error")
	}
}

func TestRead(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := Read([]obj.Object{}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Read with no arguments should return NULL_OBJECT")
	}

	// Test with too many arguments
	result = Read([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Read with too many arguments should return an error")
	}

	// Test with one argument (port)
	result = Read([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Read with non-port argument should return an error")
	}

	// Test with valid port argument
	port := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = Read([]obj.Object{port}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Read with valid port argument should return NULL_OBJECT")
	}

	// Test with closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: true,
	}
	result = Read([]obj.Object{closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Read with closed port should return an error")
	}

	// Test with output port
	outputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = Read([]obj.Object{outputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Read with output port should return an error")
	}
}

func TestReadChar(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := ReadChar([]obj.Object{}, env)
	if result.Type() != obj.CHARACTER_OBJ {
		t.Errorf("ReadChar with no arguments should return a character")
	}

	// Test with too many arguments
	result = ReadChar([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("ReadChar with too many arguments should return an error")
	}

	// Test with non-port argument
	result = ReadChar([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("ReadChar with non-port argument should return an error")
	}

	// Test with valid input port
	port := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = ReadChar([]obj.Object{port}, env)
	if result.Type() != obj.CHARACTER_OBJ {
		t.Errorf("ReadChar with valid port should return a character")
	}

	// Test with closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: true,
	}
	result = ReadChar([]obj.Object{closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("ReadChar with closed port should return an error")
	}

	// Test with output port
	outputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = ReadChar([]obj.Object{outputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("ReadChar with output port should return an error")
	}
}

func TestPeekChar(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := PeekChar([]obj.Object{}, env)
	if result.Type() != obj.CHARACTER_OBJ {
		t.Errorf("PeekChar with no arguments should return a character")
	}

	// Test with too many arguments
	result = PeekChar([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("PeekChar with too many arguments should return an error")
	}

	// Test with non-port argument
	result = PeekChar([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("PeekChar with non-port argument should return an error")
	}

	// Test with valid input port
	port := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = PeekChar([]obj.Object{port}, env)
	if result.Type() != obj.CHARACTER_OBJ {
		t.Errorf("PeekChar with valid port should return a character")
	}

	// Test with closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: true,
	}
	result = PeekChar([]obj.Object{closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("PeekChar with closed port should return an error")
	}

	// Test with output port
	outputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = PeekChar([]obj.Object{outputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("PeekChar with output port should return an error")
	}
}

func TestWrite(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := Write([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Write with no arguments should return an error")
	}

	// Test with one argument
	result = Write([]obj.Object{obj.NULL_OBJECT}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Write with one argument should return NULL_OBJECT")
	}

	// Test with two arguments (object and port)
	result = Write([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Write with non-port second argument should return an error")
	}

	// Test with valid output port
	port := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = Write([]obj.Object{obj.NULL_OBJECT, port}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Write with valid output port should return NULL_OBJECT")
	}

	// Test with closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: false,
	}
	result = Write([]obj.Object{obj.NULL_OBJECT, closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Write with closed port should return an error")
	}

	// Test with input port
	inputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = Write([]obj.Object{obj.NULL_OBJECT, inputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Write with input port should return an error")
	}

	// Test with too many arguments
	result = Write([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Write with too many arguments should return an error")
	}
}

func TestDisplay(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := Display([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Display with no arguments should return an error")
	}

	// Test with one argument
	result = Display([]obj.Object{obj.NULL_OBJECT}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Display with one argument should return NULL_OBJECT")
	}

	// Test with two arguments (object and port)
	result = Display([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Display with non-port second argument should return an error")
	}

	// Test with valid output port
	port := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = Display([]obj.Object{obj.NULL_OBJECT, port}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Display with valid output port should return NULL_OBJECT")
	}

	// Test with closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: false,
	}
	result = Display([]obj.Object{obj.NULL_OBJECT, closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Display with closed port should return an error")
	}

	// Test with input port
	inputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = Display([]obj.Object{obj.NULL_OBJECT, inputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Display with input port should return an error")
	}

	// Test with too many arguments
	result = Display([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Display with too many arguments should return an error")
	}
}

func TestNewline(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := Newline([]obj.Object{}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Newline with no arguments should return NULL_OBJECT")
	}

	// Test with one argument (non-port)
	result = Newline([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Newline with non-port argument should return an error")
	}

	// Test with valid output port
	port := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = Newline([]obj.Object{port}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("Newline with valid output port should return NULL_OBJECT")
	}

	// Test with closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: false,
	}
	result = Newline([]obj.Object{closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Newline with closed port should return an error")
	}

	// Test with input port
	inputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = Newline([]obj.Object{inputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Newline with input port should return an error")
	}

	// Test with too many arguments
	result = Newline([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Newline with too many arguments should return an error")
	}
}

func TestWriteChar(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := WriteChar([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WriteChar with no arguments should return an error")
	}

	// Test with non-character argument
	result = WriteChar([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WriteChar with non-character argument should return an error")
	}

	// Test with character argument
	char := &obj.CharacterObject{Value: 'a'}
	result = WriteChar([]obj.Object{char}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("WriteChar with character argument should return NULL_OBJECT")
	}

	// Test with character and non-port arguments
	result = WriteChar([]obj.Object{char, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WriteChar with non-port second argument should return an error")
	}

	// Test with character and valid output port
	port := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: false,
	}
	result = WriteChar([]obj.Object{char, port}, env)
	if result.Type() != obj.NULL_OBJ {
		t.Errorf("WriteChar with character and valid output port should return NULL_OBJECT")
	}

	// Test with character and closed port
	closedPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  false,
		IsInput: false,
	}
	result = WriteChar([]obj.Object{char, closedPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WriteChar with closed port should return an error")
	}

	// Test with character and input port
	inputPort := &obj.PortObject{
		File:    "dummy",
		IsOpen:  true,
		IsInput: true,
	}
	result = WriteChar([]obj.Object{char, inputPort}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WriteChar with input port should return an error")
	}

	// Test with too many arguments
	result = WriteChar([]obj.Object{char, obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("WriteChar with too many arguments should return an error")
	}
}

func TestLoad(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := Load([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Load with no arguments should return an error")
	}

	// Test with too many arguments
	result = Load([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Load with too many arguments should return an error")
	}

	// Test with non-string argument
	result = Load([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Load with non-string argument should return an error")
	}

	// Test with non-existent file
	result = Load([]obj.Object{&obj.StringObject{Value: "nonexistent.scm"}}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("Load with non-existent file should return an error")
	}
}

func TestTranscriptOn(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with no arguments
	result := TranscriptOn([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("TranscriptOn with no arguments should return an error")
	}

	// Test with too many arguments
	result = TranscriptOn([]obj.Object{obj.NULL_OBJECT, obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("TranscriptOn with too many arguments should return an error")
	}

	// Test with non-string argument
	result = TranscriptOn([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("TranscriptOn with non-string argument should return an error")
	}

	// Test with valid filename
	result = TranscriptOn([]obj.Object{&obj.StringObject{Value: "test_transcript.txt"}}, env)
	if result.Type() == obj.ERROR_OBJ {
		t.Errorf("TranscriptOn with valid filename should not return an error, got: %s", result.Inspect())
	}

	// Test when transcript is already active
	result = TranscriptOn([]obj.Object{&obj.StringObject{Value: "test_transcript2.txt"}}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("TranscriptOn when already active should return an error")
	}

	// Turn off transcript for cleanup
	TranscriptOff([]obj.Object{}, env)
}

func TestTranscriptOff(t *testing.T) {
	env := obj.NewEnvironment()

	// Test with arguments
	result := TranscriptOff([]obj.Object{obj.NULL_OBJECT}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("TranscriptOff with arguments should return an error")
	}

	// Test when transcript is not active
	result = TranscriptOff([]obj.Object{}, env)
	if _, ok := result.(*Error); !ok {
		t.Errorf("TranscriptOff when not active should return an error")
	}
}
